<?php

return CMap::mergeArray(
		require(LIBRARIES_FOLDER . '/config.php'), array(
	    // Put front-end settings there
	    // (for example, url rules).
	    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
	    'theme' => 'default',
	    'layout' => 'main',
	    'defaultController' => 'dashboard',
	    'modules' => array(
		'gii' => array(
		    'class' => 'system.gii.GiiModule',
		    'password' => 'admin'
		),
	    ),
	    'import' => array(
		'application.extensions.KEmail.KEmail',
		'application.extensions.Captcha.*'		
	    ),
	    'components' => array(
		'user' => array(		    
		    'loginUrl' => ADMINISTRATOR_URL . '/authorization/login',		    
		),
		'encrypter' => array(
		    'class' => 'Encrypter',
		    'key' => 'L0gE@r3nCryptK3y',
		),
		//Error Action when having Errors
		'errorHandler' => array(
		    'errorAction' => 'authorization/error',
		),
		'urlManager' => array(
		    'urlFormat' => 'path',
		    'showScriptName' => false,
		    'urlSuffix' => '.html',                    
		    'rules' => array(
			//Default			
			'<controller:\w+>/<action:\w+>/<id:\d+>-<alias:.*?>' => '<controller>/<action>',
			'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
			'<controller:\w+>/<action:\w+>/<type:.*?>' => '<controller>/<action>',
			'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
		    ),
		),
	    ),
	    'params' => array(
		'captcha' => array(
		    'min-length' => 5,
		    'max-length' => 5,
		    'width' => 120,
		    'height' => 40,
		    'padding' => 2,
		    'back-color' => 0xFFFFFF,
		    'fore-color' => 0x2040A0,
		    'transparent' => false
		),
		'media' => array(
		    'root' => array(
			'path' => '/media/',
			'folder_permission' => array(
			    'pattern' => '/gallery/',
			    'read' => true,
			    'write' => false,
			    'locked' => true,
			    'hidden' => false,
			),
			'file_permission' => array(
			    'pattern' => '//',
			    'hidden' => false,
			),
		    ),
		    'image' => array('path' => '/media/images/',
			'folder_permission' => array(
			    'pattern' => '/images/',
			    'read' => true,
			    'write' => true,
			    'locked' => false,
			    'hidden' => false,
			),
			'file_permission' => array(
			    'pattern' => '/[^\s]+(\.(?i)(?!(png|jpg|gif)))/',
			    'hidden' => true,
			),
		    ),
		    'lesson' => array('path' => '/media/lesson/',
			'folder_permission' => array(
			    'pattern' => '/lesson/',
			    'read' => true,
			    'write' => true,
			    'locked' => false,
			    'hidden' => false,
			),
			'file_permission' => array(
			    'pattern' => '//',
			    'hidden' => false,
			),
		    ),
		),
	    ),
		)
);